package delyqueue;

import java.util.concurrent.DelayQueue;

/**
 * @author chaird
 * @create 2023-04-16 17:18
 */
public class APPSimple {

  public static void main(String[] args) throws Exception{

    DelayQueue<DelayedUser> delayQueue = new DelayQueue<>();


    DelayedUser delayedUser1 = new DelayedUser(
            "task1", 10000000000L + System.currentTimeMillis());

    DelayedUser delayedUser0 = new DelayedUser(
            "task0", 10000000000L + System.currentTimeMillis());
    delayQueue.put(delayedUser1);
    delayQueue.put(delayedUser0);

    DelayedUser take = delayQueue.take();

    System.out.println(take);
  }
}
